// UVLightView.h : interface of the CUVLightView class
//
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INCLUDES()
#include "Util/msflexgrid.h"
//}}AFX_INCLUDES

#if !defined(AFX_UVLIGHTVIEW_H__77651E88_693E_4EF0_A538_9BB3073ADB58__INCLUDED_)
#define AFX_UVLIGHTVIEW_H__77651E88_693E_4EF0_A538_9BB3073ADB58__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include ".\Util\MinButton.h"
#include ".\Util\MinLabel.h"
#include ".\Util\MinDigital.h"
#include ".\Util\SxGroupBox.h"

#define ALL_CHANNEL 5
// Hardware Layer
class IIO;
// Process Layer
class IAutoManager;
// Common Layer
class CSystemData;
class CErrorCodeData;
class CUVLightDoc;
class CModelData;
class CLogData1;
class CUVLightData;
class CTCPIPLogData;

class CUVLightView : public CFormView
{
private:
	IIO* m_lnkIO;
protected: // create from serialization only
	CUVLightView();
	DECLARE_DYNCREATE(CUVLightView)

public:
	//{{AFX_DATA(CUVLightView)
	enum { IDD = IDD_UVLIGHT_FORM };
	CMinButton  m_bUVTimeReset;
	CMinButton	m_bQuit;
	CMinButton	m_bBuzzerOff;
	CMinButton	m_bPupperInput;
	CMinButton	m_bLowerInput;
	CMinButton	m_bUVOnOff;
	CMinButton	m_bUVLight;
	CMinButton	m_bErrorList;
	CMinButton	m_bSettingMode;
	CMinButton	m_bRunMode;
	CMinButton	m_bOrigin;
	CMinButton	m_bModelChange;
	CMinButton	m_bManualMode;
	CMinButton	m_bMainMode;
	CMinButton	m_bDataMode;
	CMinButton	m_bCycleStop;
	CMinButton	m_bAutoStop;
	CMinButton	m_bAutoStart;
	CMinButton	m_bAutoInit;
	CMinButton  m_bOperID;
	CMinButton	m_bPio;
	CMinButton	m_bRFIDReading;
	CMinButton	m_bAGVCall;
	CStatic	m_hVideoCapture;
	CMSFlexGrid	m_gridModelInfo;
	CMSFlexGrid	m_gridSystemInfo;
	CMSFlexGrid	m_gridUVDataInfo;
	//}}AFX_DATA

// Attributes
public:
	int m_nNum;

	BOOL m_flgChangeView;
	CUVLightDoc* GetDocument();

	void PeekAndPump();
	void DisplayMachineTact(CString strTact);
	// 2014. 7. 2. jyko _____________________________________
	void RefreshModelName();
	// ______________________________________________________

	int m_nInOldSts[40];
	int m_nInSts[40];
	int m_nOutOldSts[40];
	int m_nOutSts[40];

	CMinLabel	m_sHiCheck[25];
	CMinLabel	m_sLowCheck[25];
	CMinLabel	m_sWaferUpperIn;
	CMinLabel	m_sWaferLowerIn;
	CMinLabel	m_sOperID;

	CMinButton m_bInTitle[8];
	CMinButton m_bOutTitle[8];
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CUVLightView)
	public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void OnInitialUpdate(); // called first time after construct
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CUVLightView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif
	
protected:
	void LabelInitial();
	void ButtonInitial();
	void DisplayOpMode();
	void GridInitial();
	void UVTotalTime(); 
	void GridSystem();
	void GridModel();
	void GridUVData();
	void UVOnWaitTime();
	void UVOffWaitTime();
	IAutoManager* m_lnkAutoManager;
	CSystemData* m_lnkSystemData;
	CUVLightDoc* m_pDoc;	
	CModelData* m_lnkModelData;
	CUVTimeData* m_lnkUVTotalTime;
	CLogData1* m_lnkLogData;
	CUVLightData* m_lnkUVLightData;
	CTCPIPLogData* m_lnkTCPIPLogData;
	BOOL m_flgUVTimeStart;
	UINT m_nTimerID;
	BOOL m_TimerInitFlag;
// Generated message map functions
	BOOL m_flgUVOnStart;
	BOOL m_flgUVOffStart;
	BOOL m_flgUVOn;
	//////////////////////////////////////////////////////////////////////////
	BOOL m_flgHi12Check;
	BOOL m_flgHi8Check;
	BOOL m_flgHiNotWafer;
	BOOL m_flgLow12Check;
	BOOL m_flgLow8Check;
	BOOL m_flgLowNotWafer;
	char m_szTmp[100];
protected:
	//{{AFX_MSG(CUVLightView)
	afx_msg void OnQuitBtn();
	afx_msg void OnMainmode();
	afx_msg void OnDatamode();
	afx_msg void OnManualmode();
	afx_msg void OnSettingmode();
	afx_msg void OnPaint();
	afx_msg void OnModelChange();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnDestroy();
	afx_msg void OnAutoInit();
	afx_msg void OnOrigen();
	afx_msg void OnRunMode();
	afx_msg void OnAutoStart();
	afx_msg void OnAutoStop();
	afx_msg void OnCycleStop();
	afx_msg void OnStepStop();
	afx_msg void OnErrorList();
	afx_msg void OnUvLight();
	afx_msg void OnUvOnoff();
	afx_msg void OnUpperIn();
	afx_msg void OnLowerIn();
	afx_msg void OnBuzzerOff();
	afx_msg void OnOperid();
	afx_msg void OnUvtimeReset();
	afx_msg void OnPio();
	afx_msg void OnRfidReading();
	afx_msg void OnAgvCall();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in UVLightView.cpp
inline CUVLightDoc* CUVLightView::GetDocument()
   { return (CUVLightDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_UVLIGHTVIEW_H__77651E88_693E_4EF0_A538_9BB3073ADB58__INCLUDED_)
